package com.wannengbang.cloudleader.service;


import android.os.Bundle;
import android.widget.TextView;

import com.wannengbang.cloudleader.R;
import com.wannengbang.cloudleader.base.BaseActivity;
import com.wannengbang.cloudleader.bean.CardListBean;
import com.wannengbang.cloudleader.utils.NumberFormatUtils;
import com.wannengbang.cloudleader.widget.AppTitleBar;

import butterknife.BindView;
import butterknife.ButterKnife;

public class CardDetailsActivity extends BaseActivity {

    @BindView(R.id.title_bar)
    AppTitleBar titleBar;
    @BindView(R.id.edit_name)
    TextView editName;
    @BindView(R.id.edit_no)
    TextView editNo;
    @BindView(R.id.edit_limit)
    TextView editLimit;
    @BindView(R.id.tv_bank_name)
    TextView tvBankName;
    @BindView(R.id.tv_due_day)
    TextView tvDueDay;
    @BindView(R.id.tv_bill_day)
    TextView tvBillDay;
    @BindView(R.id.tv_expiry_date)
    TextView tvExpiryDate;
    private CardListBean.DataBean.ItemListBean dataBean;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_card_details);
        ButterKnife.bind(this);
        initView();
    }

    public void initView() {
        dataBean = (CardListBean.DataBean.ItemListBean) getIntent().getSerializableExtra("DataBean");
        if (dataBean != null) {
            editName.setText(dataBean.getReal_name());
            editNo.setText(dataBean.getNo());
            String limit = NumberFormatUtils.formatDouble(Double.parseDouble(dataBean.getLimit()) / 100);
            editLimit.setText(limit);
            tvBankName.setText(dataBean.getBank_name());
            tvDueDay.setText(dataBean.getDue_day());
            tvBillDay.setText(dataBean.getBill_day());
            tvExpiryDate.setText(dataBean.getExpiry_date());
        }
    }
}
